<?php 
include 'all.php';
include '../head.php'; ?>
<title>Profile | Child</title>

<body>
    <div id="wrapper">

        <?php include '../header_profile.php'; ?>
        <?php include '../menu_left.php'; ?>
        <div class="salus_bank_reg float_left">


    <a class="float_left" href="">
        <!--                    <div class="salus_bank_logo logo"></div>-->
        <img src="../../include/images/baby.png" width="104px;" />
        <div class="down_arrow"></div>
    </a>
    <div class="clear"></div>

    <div class="float_left top_menu "><a href="#">PRINT</a></div>    


    <div class="clear"></div>
       
        <div class="clear"></div>




        <div id="mainContent">         
            <hr>
            <?php
            /*
             * To change this template, choose Tools | Templates
             * and open the template in the editor.
             */
            ob_start();
            //include(dirname(__FILE__).'pf.php');
//    include '../../plugins/pdf/examples/res/child_profile.php';
            include '../print/child_profile.php';
            $content = ob_get_clean();
            $filename = rand(0, 10000).'_'.$_COOKIE['bid'].'.pdf';
            //$path = 'http://'.$_SERVER['HTTP_HOST'].'/salusbaby/storage/temps/';
//            $path = '/var/www/html/salusbaby/storage/temps/';
            $path = '/home/salusban/www/salusbank.ch/salusbaby/storage/temps/';
            require_once '../../plugins/pdf/html2pdf.class.php';
            try {
                $html2pdf = new HTML2PDF('P', 'A4', 'fr');
                $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
                if ($_GET['actor'] == 'CHILD')
                    $html2pdf->Output($path.$filename, 'F');
                if ($_GET['actor'] == 'FATHER')
                    $html2pdf->Output($path.$filename, 'F');
                if ($_GET['actor'] == 'MOTHER')
                    $html2pdf->Output($path.$filename, 'F');
                


                echo 'PDF Generated';
            } catch (HTML2PDF_exception $e) {
                echo $e;
                exit;
            }
       
            ?>
            <form action="<?='http://'.$_SERVER['HTTP_HOST'].'/salusbaby/plugins/mail/mail1.php'?>" method="post" >
                <input type="hidden" name="filename" value="<?=$path.$filename?>" />
                <table>
                    <tr><td>To : </td><td><input type="text" name="to"  /></td></tr>
                    <tr><td>Subject : </td><td><input type="text" name="subject"  /></td></tr>
                    <tr><td>Message : </td><td><input type="text" name="message"  /></td></tr>                    
                </table>
                <input type="submit" value="Send" />
            </form>

        </div>

    </div><!-- wrapper over    -->
<?php
include '../../include/config.php';
include '../menu_right.php';
?>
</body>
</html>
